home *** CD-ROM | disk | FTP | other *** search
- <%@ page language="java" import="
- java.util.*,
- com.jproxy.site.*"
- %>
-
- <jsp:useBean id="ses" scope="session" class="com.jproxy.site.JSPSession"/>
-
- <%
- String sPageId = null;
- String sMenuType = "";
-
- sPageId = ses.getParameter("pageId");
- if(ses.getLogin()==null)
- sMenuType = MT_LOGIN;
- if(ses.getLogin()!=null)
- if(ses.getLogin().getHasClients())
- sMenuType = MT_OEM;
- if(ses.getLogin()!=null)
- if(!ses.getLogin().getHasClients())
- sMenuType = MT_CUSTOMER;
-
- //sMenuType = ses.getParameter("menuType");
- %>
- <!-- NAVIGATION BAR -->
-
- <table width="100" cellpadding=0 cellspacing=0 border=0 height=100%>
- <tr>
- <td valign=top>
- <table border=0 cellspacing=2 cellpadding=1>
- <!-- Company Tab Begins -->
- <tr>
- <td>
- <img src="<%=JSPRes.path%>/main/resources/tb-eportal.gif" alt="Customer Relation Management Console"/>
- </td>
- </tr>
- <%
-
- MenuItem[] navigationBar = getNavigationBar(sMenuType);
- if(navigationBar!=null)
- for(int i=0; i<navigationBar.length; i++)
- {
- MenuItem menu = (MenuItem)navigationBar[i];
- %>
- <tr>
- <td>
- <%
- if(!menu.id.equalsIgnoreCase(sPageId))
- {
- %>
- <a class='menu' href="<%=menu.href%>" alt="<%=menu.alt%>"><%=menu.name%></a>
- <%
- }
- else
- {
- %>
- <span class='h8VerdanaBold'><%=menu.name%></a>
- <%
- }
- %>
- </td>
- </tr>
- <%
- }
- %>
- </table>
- </td>
- </tr>
- </table>
-
- <%!
- static final private String MT_LOGIN = "login";
- static final private String MT_OEM = "oem";
- static final private String MT_CUSTOMER = "customer";
-
- static final private String PAGE_HOME = "home";
- static final private String PAGE_LOGIN = "login";
- static final private String PAGE_TERMS = "terms";
- static final private String PAGE_MY_PROFILE = "my_profile";
- static final private String PAGE_CUSTOMER_LIST = "customer_list";
- static final private String PAGE_PRODUCT_LIST = "product_list";
- static final private String PAGE_NEW_CUSTOMER = "new_customer";
- static final private String PAGE_EDIT_CUSTOMER = "edit_customer";
- static final private String PAGE_LOGOUT = "logout";
- static final private String PAGE_PURCHASE_DETAILS = "purchase_details";
- static final private String PAGE_MESSAGEBOX = "messagebox";
-
- private MenuItem[] m_arrLoginMenu = {
- // new MenuItem(PAGE_HOME, JSPRes.path+"/main/index.jsp", "JProxy Home", "Home"),
- new MenuItem(PAGE_LOGIN, JSPRes.path+"/main/customers/login.jsp", "ePortal Login", "Login"),
- new MenuItem(PAGE_TERMS, JSPRes.path+"/main/customers/terms.jsp", "Terms and Conditions using ePortal", "Terms")
- };
-
- private MenuItem[] m_arrOemMenu = {
- new MenuItem(PAGE_MY_PROFILE, JSPRes.path+"/main/customers/acedit.jsp?key=edit&forward=customer-list.jsp",
- "Lets you change your personal information", "My Profile"),
- new MenuItem(PAGE_CUSTOMER_LIST, JSPRes.path+"/main/customers/customer-list.jsp",
- "Displays a list of your customers", "My Customers"),
- new MenuItem(PAGE_NEW_CUSTOMER, JSPRes.path+"/main/customers/customer-edit.jsp?key=new&forward=customer-list.jsp",
- "Creates a new customer", "New Customer"),
- new MenuItem(PAGE_LOGOUT, JSPRes.path+"/main/customers/login.jsp?logout=true",
- "Logs you out from ePortal and allows you to log in as a different user", "Logout"),
- new MenuItem(PAGE_TERMS, JSPRes.path+"/main/customers/terms.jsp",
- "Terms and Conditions using ePortal", "Terms")
- };
-
- private MenuItem[] m_arrCustomerMenu = {
- new MenuItem(PAGE_MY_PROFILE, JSPRes.path+"/main/customers/acedit.jsp?key=edit&forward=product-list.jsp",
- "Lets you change your personal information", "My Profile"),
- new MenuItem(PAGE_PRODUCT_LIST, JSPRes.path+"/main/customers/product-list.jsp",
- "Lets you review available products", "Products"),
- new MenuItem(PAGE_LOGOUT, JSPRes.path+"/main/customers/login.jsp?logout=true",
- "Logs you out from ePortal and allows you to log in as a different user", "Logout"),
- new MenuItem(PAGE_TERMS, JSPRes.path+"/main/customers/terms.jsp",
- "Terms and Conditions using ePortal", "Terms")
- };
-
- MenuItem[] getNavigationBar(String menuType)
- {
- MenuItem[] res = null;
- if(menuType==null)
- return res;
- if(menuType.equalsIgnoreCase(MT_LOGIN))
- res = m_arrLoginMenu;
- if(menuType.equalsIgnoreCase(MT_OEM))
- res = m_arrOemMenu;
- if(menuType.equalsIgnoreCase(MT_CUSTOMER))
- res = m_arrCustomerMenu;
- return res;
- }
-
- class MenuItem
- {
- public String id = "";
- public String href = "";
- public String alt = "";
- public String name = "";
-
- public MenuItem(String _id, String _hRef, String _alt, String _name)
- {
- id = _id.trim();
- href = _hRef.trim();
- alt = _alt.trim();
- name = _name.trim();
- }
- }
- %>
-